package com.sbck.cs3.fragment;

import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioButton;

import com.sbck.cs3.MyGlobal;
import com.sbck.cs3.MyClass.MyOpenHelper;
import com.sbck.cs3.R;
import com.sbck.cs3.databinding.FragmentSettingBinding;

public class SettingFragment extends Fragment {


    MyOpenHelper openHelper ;
    DeviceSelectFragment deviceSelectFragment;

    FragmentSettingBinding mBinding;

    @Override
    public void onAttach(Context context)
    {
        super.onAttach(context);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_setting, container, false);


        deviceSelectFragment = new DeviceSelectFragment();


        mBinding = FragmentSettingBinding.inflate(inflater,container,false);
        mBinding.setSetting(MyGlobal.setting);
        return mBinding.getRoot();
    }


    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        RadioButton radioButtonWifi = view.findViewById(R.id.RBtn_Setting_Wifi);
        RadioButton radioButtonNet = view.findViewById(R.id.RBtn_Setting_PublicNet);

        if(MyGlobal.loginUser.LoginName.get().equals("sbck") && MyGlobal.loginUser.Password.get().equals("sbck"))
        {

        }
        else
        {
            radioButtonWifi.setVisibility(View.VISIBLE);
            radioButtonNet.setVisibility(View.VISIBLE);
        }
    }

}